package puan.com.weighBox.activity;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import puan.com.weighBox.R;
import puan.com.weighBox.base.BaseActivity;
import puan.com.weighBox.presenter.AdminPresenter;
import puan.com.weighBox.viewInterface.IAdminView;

import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.TextView;

/**
 * 管理者操作界面
 */
public class AdminActivity extends BaseActivity implements View.OnClickListener, IAdminView {

    private AdminPresenter presenter;
    private ImageView ivOption;
    private Toolbar toolbar;


    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.ivOption:
                presenter.showMorePopupwindow(AdminActivity.this, toolbar);
                break;
            default:
                break;
        }
    }

    @Override
    public int initLayout() {
        return R.layout.activity_admin;
    }

    @Override
    public void initView(@Nullable Bundle savedInstanceState) {
        ((TextView) findViewById(R.id.tvToolTitle)).setText("导入");
        toolbar = findViewById(R.id.toolbar);
        ivOption = findViewById(R.id.ivOption);
        ivOption.setVisibility(View.VISIBLE);
        ivOption.setOnClickListener(this);
    }

    @Override
    public void initData() {
        presenter = new AdminPresenter(this);
    }
}
